﻿using System.Windows.Forms;
using System.Threading;
using Home.Mobilesales.Common;
using Home.MobileSales.Sales.Interface;
using Home.MobileSales.Sales.View;
using Home.MobileSales.WorkGps;

namespace Home.MobileSales.Sales.Presenter
{
    class SplashFormPresenter
    {
        public SplashFormPresenter(ISplashWindowView splash)
        {
            splash.PaintProcess(10, "Настройки");
            try
            {
                if (Settings.GetInstance().EnableGPS)
                {
                    GpsWorker.GetInstance().StartGps();
                }
            }
            catch
            {
                ExceptionWork.ExeptionProcess(new OtherException("Помилка при завантаженні настройок"));
                new SettingsForm().ShowDialog();
            }
            splash.PaintProcess(50, "Товари");
            splash.PaintProcess(75, "Головна форма");
        }
    }
}
